<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.ncp.model.entity.cart.CartBean"%>
<jsp:useBean id="cart" scope="session" class="com.ncp.model.biz.cart.ShoppingCart"/>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>确认订单信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="css/common.css" type="text/css" rel="stylesheet" />
	<link href="css/list.css" type="text/css" rel="stylesheet" />
	<link href="css/sure.css" type="text/css" rel="stylesheet" />
	<link rel="stylesheet" type="text/css" href="css/cart.css">
	<script src="js/cart/cart.js" type="text/javascript" charset="UTF-8"></script>
	<style type="text/css">
*{ padding:0; margin:0; border:0; font-size:12px;}
#shopping{ width:870px; margin:0 auto;}
.location{ border-bottom:2px solid #418051; line-height:40px;}
.flow{ background:url(images/flow.png) no-repeat; width:863px; height:40px; margin:20px auto;}
.title{ color:#65B12D; font-size:16px; line-height:40px;}
#show{ width:870px; border:1px solid #DDD;}
#show .head{ background:url(images/slice_5.png) repeat-x; height:31px;}
#show .head .common{ float:left; text-align:center; line-height:31px; font-size:14px; border-right:1px solid #DDD;}
#show .a{ width:120px;}
#show .b{ width:290px;}
#show .c{ width:110px;}
#show .d{ width:90px;}
#show .e{ width:100px;}
#show .f{ width:90px;}
#show .line{ border-top:1px solid #DDD;}

#show .line .common{ text-align:center; float:left; line-height:160px; border-right:1px solid #DDD;}
#show .head .g{ width:60px; border:0;}

#show .line .g{ border-right:0;}
#show .line .a a{ width:90px; height:120px; display:block; margin:20px auto;}
#show .line .a a img{ width:90px; height:120px; display:block; margin:20px auto;}

#show .line .e{ height:100px; padding-top:60px;}
#show .line .b p{ padding-left:20px; text-align:left;}
#show .line .g p a{ color:#000; text-decoration:none;}
#show .line .g p a:hover{ text-decoration:underline; color:#666;}
.right{ float:right;}
.left{ float:left;}
.red{ color:#F03;}
#show .foot{ padding:0 30px; line-height:35px; height:35px; background:url(images/slice_6.png) repeat-x;}

</style>
	<script type="text/javascript">
	function continue1(){
		window.location.href="SearchProductServlet?type=all&name=all";
	}
	</script>
  </head>
  
  <body>
<div id="allpage">
	<jsp:include flush="true" page="../index/head.jsp"></jsp:include>
	<div id="main" style="padding:0 20px;width:880px;">
		<div id="position">
			<p>您的位置：<a href="#">首页</a>&emsp;>&emsp;我的购物车</p>
		</div>
		
		<div id="step">
			<ul>
				<li class="left current">1.查看购物车</li>
				<li class="left">2.确认订单信息</li>
				<li class="left">3.付款到支付宝</li>
				<li class="left">4.确认收货</li>
				<li class="left">5.评价</li>
			</ul>
		</div>
		<div style="clear:both"></div>
	<p class="title">我的购物车</p>
	<div id="show">
		<div class="head">
			<div class="a common">商品</div>
			<div class="b common">商品名称</div>
			<div class="c common">积分</div>
			<div class="d common">单价</div>
			<div class="e common">数量</div>
			<div class="f common">金额小计</div>
			<div class="g common">操作</div>
		</div>
		
		
		<%
    					if(cart.getProductNum()!=0){
    					Map<String,CartBean> cartMap = null;
    					cartMap = cart.getCartMap();
    					CartBean cartBean = null;
    					Iterator<String> hmkey = cartMap.keySet().iterator();
    					while(hmkey.hasNext()){
    						cartBean = cartMap.get(hmkey.next());
    				%>
    		<div class="line">
					<div class="a common">
						<a class="img_demo" href="#">
							<img src="<%=cartBean.getProductImage() %>" />
						</a>
					</div>
					<div class="b common">
						<p><%=cartBean.getProductName() %></p>
					</div>
					<div class="c common">
						<p><%=cartBean.getRetailPrice() %></p>
					</div>
					<div class="d common">
						<p>￥<%=cartBean.getRetailPrice() %></p>
					</div>
					<div class="e common">
						<div style="">
							<input type="text" value="<%=cartBean.getProductNumOfCart() %>" id="amount_1" style=" width:20px;height:24px; border:1px solid #DDD; text-align: center;" />
						</div>
					</div>
					<div class="f common">
						<p>￥<%=(cartBean.getRetailPrice() * cartBean.getProductNumOfCart())%></p>
					</div>
					<div class="g common">
						<p style="margin:70px 0 0 20px;"><input type="submit" value="删除" onclick="delProduct('<%=cartBean.getProductID()%>')" style="cursor:pointer;" /></p>
					</div>
						<div style="clear:both">
					</div>
			</div>
			
					<%
    					}
    	 			}else{
    	 			%>
    	 				您还没有选择任何商品！
    	 			<%
    	 			}
    	  			%>
    	  			<div class="foot">
				<span onclick="emptyCart()" class="left">清空购物车</span>
				<p class="right">商品数量总计：<span class="red"><%=cart.getProductNum() %>件</span>&emsp;&emsp;商品金额总计：<span class="red">￥<%=cart.getTotalprice() %></span></p>
			</div>
				</div>
	<br />
    	 <form name="pay_now_form" action="ConfirmOrderServlet" method="post">
			<input type="button" onclick="continue1()" value="" style="background:url(images/continue.png) no-repeat; cursor:pointer; width:107px; height:40px; " />
			<input type="submit" value="" style="background:url(images/cal.png) no-repeat; cursor:pointer; width:107px; height:40px;" />
		</form>
	</div>
	</div>
	
	
	<jsp:include flush="true" page="../index/foot.jsp"></jsp:include>
	
</div>

</body>
</html>
